<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="./css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./css/style.css" />
    <link rel="stylesheet" type="text/css" href="./css/font-awesome.min.css" />
    <script type="text/javascript" src="./script/jquery.min.js"></script>
</head>
<body>
    <header class="aui-bar aui-bar-nav header">
      <a class="aui-pull-left">
          <span class="aui-iconfont aui-icon-left" onclick="api.closeWin()"></span>
      </a>
        <div class="aui-title">修改密码</div>
        <a class="aui-pull-right aui-btn">
            <!-- <span class="fa fa-user-circle-o"></span> -->
        </a>
    </header>
    <div class="header-d"></div>

    <!-- 修改密码 -->
    <div class="aui-content login">
        <ul class="aui-list aui-form-list">
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label-icon">
                        <i class="aui-iconfont aui-icon-lock"></i>
                    </div>
                    <div class="aui-list-item-input">
                        <input type="password" placeholder="重置密码" name='password'>
                    </div>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label-icon">
                        <i class="aui-iconfont aui-icon-lock"></i>
                    </div>
                    <div class="aui-list-item-input">
                        <input type="password" placeholder="确认密码" name='confirm'>
                    </div>
                    <!-- <div class="aui-list-item-label-icon">
                    <i class="aui-iconfont aui-icon-display"></i>
                </div> -->
                </div>
            </li>
        </ul>
        <div class="aui-btn aui-btn-info aui-btn-block" onclick="modify()">修改</div>
    </div>

</body>
<script type="text/javascript" src="./script/api.js"></script>

</html>
<script>
    function modify() {

      var password = $('input[name="password"]').val();
      var confirm = $('input[name="confirm"]').val();
      if (password!='' &&modify==modify) {
      var tempassWord = $api.getStorage('passWord');
      var b = $api.getStorage('currentPassword');
      tempassWord[b]= password;
    $api.setStorage('passWord', tempassWord);
    alert('修改成功！');
      api.closeWin();

      }else {
            api.toast({
                msg: '请正确输入密码！',
                duration: 2000,
                location: 'middle'
            });
      }


    }
</script>
